package com.module.antiFake.vo;

import java.util.Date;

import base.common.CUDEnum;

/**
 * 记录扫码记录次数 ;
 * @author wult
 */

public class AntiFakeScanTimes implements java.io.Serializable {

	private static final long serialVersionUID = 1330022279067955250L;
	private Long id;
	private String codeInfo;
	private String productId;
	private String productName;
	private Integer times;
	private Short type;
	private Short layerNum;
	private String orgid;
	private String createrid;
	private Date createtime;
	private String updaterid;
	private Date updatetime;
	private String status;
	private String firstCodeInfo;
	private String imei;
	
	private Short secondScaned;
	
	private String orgName;	//组织名称;
	
	private String rollNum;        //卷号
	
	private String batchNo;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getCodeInfo() {
		return codeInfo;
	}
	public void setCodeInfo(String codeInfo) {
		this.codeInfo = codeInfo;
	}
	public Integer getTimes() {
		return times;
	}
	public void setTimes(Integer times) {
		this.times = times;
	}
	public Short getType() {
		return type;
	}
	public void setType(Short type) {
		this.type = type;
	}
	public Short getLayerNum() {
		return layerNum;
	}
	public void setLayerNum(Short layerNum) {
		this.layerNum = layerNum;
	}
	public String getOrgid() {
		return orgid;
	}
	public void setOrgid(String orgid) {
		this.orgid = orgid;
	}
	public String getCreaterid() {
		return createrid;
	}
	public void setCreaterid(String createrid) {
		this.createrid = createrid;
	}
	public Date getCreatetime() {
		
		return createtime;
	}
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	public String getUpdaterid() {
		return updaterid;
	}
	public void setUpdaterid(String updaterid) {
		this.updaterid = updaterid;
	}
	public Date getUpdatetime() {
		return updatetime;
	}
	public void setUpdatetime(Date updatetime) {
		this.updatetime = updatetime;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getFirstCodeInfo() {
		return firstCodeInfo;
	}
	public void setFirstCodeInfo(String firstCodeInfo) {
		this.firstCodeInfo = firstCodeInfo;
	}
	
	/**
	 * 从扫码记录中生成扫码次数统计对象
	 * @param antiFakeScanHistory
	 * @return
	 */
	public static AntiFakeScanTimes copyFromAntiFakeScanHistory(
			AntiFakeScanHistory antiFakeScanHistory) {
		AntiFakeScanTimes antiFakeScanTimes = new AntiFakeScanTimes();
		antiFakeScanTimes.setCodeInfo(antiFakeScanHistory.getCodeInfo());
		antiFakeScanTimes.setCreaterid(antiFakeScanHistory.getCreaterid());
		antiFakeScanTimes.setFirstCodeInfo(antiFakeScanHistory.getFirstCodeInfo());
		antiFakeScanTimes.setLayerNum(antiFakeScanHistory.getLayerNum());
		antiFakeScanTimes.setOrgid(antiFakeScanHistory.getOrgid());
		antiFakeScanTimes.setStatus(CUDEnum.C.toString());
		antiFakeScanTimes.setTimes(1);
		antiFakeScanTimes.setType(antiFakeScanTimes.getType());
		antiFakeScanTimes.setUpdaterid(antiFakeScanHistory.getUpdaterid());
		antiFakeScanTimes.setUpdatetime(new Date());
		antiFakeScanTimes.setProductId(antiFakeScanHistory.getProductId());
		antiFakeScanTimes.setProductName(antiFakeScanHistory.getProductName());
		antiFakeScanTimes.setImei(antiFakeScanHistory.getImei());
		antiFakeScanTimes.setOrgName(antiFakeScanHistory.getOrgName());
		antiFakeScanTimes.setRollNum(antiFakeScanHistory.getRollNum());
		antiFakeScanTimes.setBatchNo(antiFakeScanHistory.getBatchNo());
		return antiFakeScanTimes;
	}
	public String getProductId() {
		return productId;
	}
	public void setProductId(String productId) {
		this.productId = productId;
	}
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}

	public Short getSecondScaned() {
		if(secondScaned == null){
			secondScaned = new Short("0");
		}
		return secondScaned;
	}

	public void setSecondScaned(Short secondScaned) {
		this.secondScaned = secondScaned;
	}
	
	public String getImei() {
		return imei;
	}
	public void setImei(String imei) {
		this.imei = imei;
	}
	public String getOrgName() {
		return orgName;
	}
	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}
	public String getRollNum() {
		return rollNum;
	}
	public void setRollNum(String rollNum) {
		this.rollNum = rollNum;
	}
	public String getBatchNo() {
		return batchNo;
	}
	public void setBatchNo(String batchNo) {
		this.batchNo = batchNo;
	}

	
}